﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Enquiries.aspx.cs" Inherits="CustomerContactSystem.WebForms.Enquiries.Customers.Enquiries" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<h1 id="EnquiryHeader" runat="server">Enquiry: <asp:hyperlink ID="EnquiryIdCaption" runat="server"></asp:hyperlink></h1>
<h2>Customer Enquiries</h2>

<asp:HyperLink ID="ExcelLink" runat="server" Target="_blank" CssClass="excel">
    <asp:Image ID="ExcelImage" runat="server" ImageUrl="~/Content/Images/excel.gif" AlternateText="View in Excel" />View in Excel
</asp:HyperLink>
<asp:Repeater ID="EnquiriesList" runat="server" OnItemDataBound="EnquiriesListItemDataBound" EnableViewState="false">
<HeaderTemplate>
<table>
    <thead>
        <tr>
            <th id="CcId">Id</th>
            <th id="Enquiry" class="medium">Enquiry</th>
            <th id="Source">Source</th>
            <th id="Received">Received</th>
            <th id="Deadline">Deadline</th>
            <th id="Department">Department</th>
            <th id="Category">Category</th>
            <th id="Status">Status</th>
            <th id="With">With</th>
        </tr>
    </thead>
    <tbody>
</HeaderTemplate>
<ItemTemplate>
        <tr id="EnquiryRow" runat="server">
            <td id="CcIdCell" runat="server" headers="CcId"><a id='<%#Eval("Id")%>'></a><%#Eval("Id")%></td>
            <td id="EnquiryCell" runat="server" headers="Enquiry" class="enquiry">
                <asp:HyperLink ID="EnquiryLink" runat="server"></asp:HyperLink>
                <asp:Literal ID="EnquiryDetail" runat="server"></asp:Literal>
            </td>
            <td id="SourceCell" runat="server" headers="Source"><%#Eval("Source.SourceName")%></td>
            <td id="ReceivedCell" runat="server" headers="Received"><%#Eval("DateOfEnquiry", "{0:d}")%></td>
            <td id="DeadlineCell" runat="server" headers="Deadline"><%#Eval("Deadline", "{0:d}")%></td>
            <td id="DepartmentCell" runat="server" headers="Department"><%#Eval("Category.Department.DepartmentName")%></td>
            <td id="CategoryCell" runat="server" headers="Category"><%#Eval("Category.CategoryName")%></td>
            <td id="StatusCell" runat="server" headers="Status"><%#Eval("CurrentStatus")%></td>
            <td id="WithCell" runat="server" headers="With"><%#Eval("CurrentReferral.CurrentlyReferredTo.DisplayName")%></td>
        </tr>
</ItemTemplate>
<FooterTemplate>
    </tbody>
</table>
</FooterTemplate> 
</asp:Repeater>  
</asp:Content>